package goleetcode

func distributeCandies(candies int, num_people int) []int {
	res := make([]int, num_people)
	i := 0
	for candies != 0 {
		res[i % num_people] += min(candies, i + 1)
		candies -= min(candies, i + 1)
		i++
	}
	return res
}